package com.bdq.common.feign.user;

import com.bdq.common.entity.common.CommonResult;
import com.bdq.common.feign.user.param.UserGetParam;
import com.bdq.common.feign.user.vo.UserFollowVO;
import com.bdq.common.feign.user.vo.UserGetVO;
import com.bdq.common.feign.user.vo.UserListVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author malei
 * @date 2024-05-21 16:03
 */
@FeignClient(name = "bdq-user")
public interface UserFeign {

    /**
     * 前缀
     */
    String PREFIX = "user";

    /**
     * 查询用户
     *
     * @param param
     * @return
     */
    @PostMapping(PREFIX + "/get")
    CommonResult<UserGetVO> getUser(@RequestBody UserGetParam param);

    /**
     * 列表查询用户
     *
     * @param userIds
     * @return
     */
    @PostMapping(PREFIX + "/list")
    CommonResult<List<UserListVO>> listUser(@RequestParam("userIds") List<Long> userIds);


    /**
     * 列表查询用户关注
     *
     * @param followerUserId
     * @param followedUserIds
     * @return
     */
    @PostMapping(PREFIX + "/follow/list")
    CommonResult<List<UserFollowVO>> listUserFollow(@RequestParam("followerUserId") Long followerUserId, @RequestParam("followedUserId") List<Long> followedUserIds);
}
